<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
	<style>
		body, input{
			font-family: Calibri, Arial;
		}
		table#contact {
			border-collapse: collapse;
			width:550px;
		}
		th {
			height: 40px;
			background-color: #ffee55;
		}
	</style>
	<title>SottoCategoria Manager - Project Live!</title>
</head>
<body>
	<h1>Inserimento SottoCategoria</h1>
	<s:actionerror/>

	<s:form action="addSottoCategoria" method="post">
		<s:textfield name="sottocategoria.nome" label="Nome"/>
		<s:textfield name="sottocategoria.descrizione" label="descrizione"/>
		<s:textfield name="sottocategoria.categoriapadre" label="Categoria"/>
		<s:submit value="Aggiungi Sotto Categoria" align="center"/>
	</s:form>

	</br></br>
	<h2>SottoCategoria</h2>
	<table id="rounded-corner">
		<tr>
			<th class="width5 textCenter">#</th>
			<th class="width40 textLeft">Nome</th>
			<th class="width40 textLeft">Descrizione</th>
			<th class="width40 textLeft">Categoria</th>
			<th class="width10 textCenter">Elimina</th>
			<th class="width10 textCenter">Modifica</th>
		</tr>
		<s:iterator value="sottocategorie">
		<tr>
			<td class="textCenter">
				<s:property value="id"/>
			</td>
			<td><s:property value="nome"/></td>
			<td><s:property value="descrizione"/></td>
			<td><s:property value="categoriapadre"/></td>		
			<td>
				 <s:form theme="simple">			        
			        <s:submit action="deleteSottoCategoria" value="Remove" onclick="return confirm('Are you sure you want to delete this item?');"/>
			        <s:submit action="displayEdit" value="Edit"/>
			        <s:hidden name="id" value="%{id}"/>
			    </s:form>
			</td>
		</tr>	
		</s:iterator>
	</table>
</body>
</html>